﻿using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyCompanyName.AbpZeroTemplate.Prm.Admin
{
    /// <summary>
    /// 各项目阶段的定义。可以连续选择多个阶段到一个项目中。
    /// </summary>
    public class PhaseInfo : FullAuditedEntity<int>
    {
        /// <summary>
        /// 阶段名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 序号--必须为连续
        /// </summary>
        public int Indexno { get; set; }

        [ForeignKey("PhaseId")]
        public virtual ICollection<PhaseItem> PhaseItems { get; set; }
        
        /// <summary>
        /// 阶段内子节点的数量，==0则无子节点定义
        /// </summary>
        public int ItemCount { get; set; }
        /// <summary>
        /// 是否可用
        /// </summary>
        public bool IsEnabled { get; set; }

    }

    /// <summary>
    /// 各项目阶段内的子节点定义
    /// </summary>
    public class PhaseItem : FullAuditedEntity<int>
    {
        /// <summary>
        /// 所属阶段
        /// </summary>
        public int PhaseId { get; set; }

        /// <summary>
        /// 阶段名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 序号--必须为连续
        /// </summary>
        public int Indexno { get; set; }

        ///// <summary>
        ///// 计划耗时 （天）
        ///// </summary>
        //public int ElapsedDay { get; set; }
        public bool IsEnabled { get; set; }
    }


}
